#include "app_runner.h"
#include "app_bt.h"
#include "log/log.h"
#include "app_device.h"

static int is_running=1;

//运行器，用来启动各个模块
int app_runner_run(void){
    //1.初始化设备，内部包含初始化线程池、MQTT
    Device * device= app_device_init(DEVICE_FILE);
    //2.初始化蓝牙,内部包含初始化串口
    app_bt_init(device);
    //3.启动设备
    app_device_start(device);
    //4.启动等待1s再继续，直到不运行
    while (is_running==1)
    {
        sleep(1);
    }
    //5.销毁设备
    app_device_destroy(device);
}
